package com.gwm.path;

import java.nio.file.Path;
import java.nio.file.Paths;

public class PathDemo {

    public static void main(String[] args) {
        String path = "oss-scrm/if-fe-assets/dms-public/img/N2.jpg";

        Path startingDir = Paths.get(path);


        Path fileName = startingDir.getFileName();

        System.out.println(fileName);

        Path subpath = startingDir.subpath(0, 1);
        System.out.println(subpath);

        int nameCount = startingDir.getNameCount();
        System.out.println(nameCount);

        Path subpath1 = startingDir.subpath(1, nameCount);
        System.out.println(subpath1);

    }
}
